package t211201;

/**
 * @Author: DengJia
 * @Date: 2021/12/1 20:59
 * @Description: 构造器内部的多态方法的行为
 */
public class PolyConstructors {
    public static void main(String[] args) {
        new RoundGlyph(10);
    }
}

class Glyph {
    void draw() {
        System.out.println("字形绘制~");
    }

    public Glyph() {
        System.out.println("Glyph构造之前");
        draw();
        System.out.println("Glyph构造之后");
    }
}

class RoundGlyph extends Glyph {
    private int radius = 1;

    public RoundGlyph(int radius) {
        this.radius = radius;
        System.out.println("圆形字形构造~半径为：" + radius);
    }

    @Override
    void draw() {
        System.out.println("圆形字形绘制~半径为：" + radius);
    }
}
